Repository navigation
feat(PhyslibAlpha): rational values of the 3j symbols of a Regge square - #2100
dl-eigenart wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thank you for this pull-request (PR). If this is your first PR, welcome to the community! While you wait for a review, note that you can review PRs too; reviewing is not restricted to maintainers. Our review guidelines explain what to look for. Over time, contributions such as reviews, maintenance and documentation are recorded on contributions.physlib.io. Three main points:
|
|
Just to let you know that we have changed the policy regarding PR descriptions. The new policy is that they should be human written and concise. The reason for this is that we found that the AI written doc-strings were essentially been read by no-one, and were not particularly useful. It is good to think as PR descriptions as forming part of the code, and as much care and attention should be given to them as to the Lean code itself. Would you mind changing your future PR descriptions accordingly? |
|
@jstoobysmith okay, I´ll keep it in mind. |
This PR adds PhyslibAlpha/QuantumMechanics/AngularMomentum/Wigner3jRational.lean. The file provides rational computational aids for the existing real definitions from Wigner3j.lean and links them to those definitions via cast lemmas.
This allows specific values of the square and the signed square of a Wigner-3j symbol to be checked using decide +kernel, without native_decide and without additional axioms.
The file contains rational versions of the existing building blocks:
invFactQ
negOnePowQ
sixTermQ
sixSumQ
For a Regge square R, four additional definitions are added:
threeJRRadQ: the rational quantity under the root
threeJRSumQ: the rational sum
threeJRSqQ: the square of the 3j symbol
threeJRSgnSqQ: the product of the 3j symbol and its magnitude
For each definition, there is a cast_… lemma that demonstrates, after casting to ℝ, that it matches the corresponding real expression. The lemma threeJR_eq_rat also represents the real 3j symbol as a sign × root of a rational number × rational number.
Why use rational computational aids?
The existing definition of threeJR contains a real root and a finsum. It is therefore not immediately suitable for the intended evaluation of specific table values in the kernel.
The 3j symbol itself is generally irrational. Its square, however, is rational. The product of the symbol and its absolute value is also rational and, in addition, preserves the sign: For a real number x, the number x·|x| determines both |x| and the sign of x.
The rational sum is restricted to the domain in which all factorials have nonnegative arguments. This allows it to be evaluated as a finite, computable sum. The Cast lemmas ensure that this calculation continues to correspond to the existing real definitions.
Examples:
Two examples use decide +kernel to check the following rational product values:
threeJRSgnSqQThese examples serve as proof that the kernel check works. A more comprehensive collection of tabulated values is not part of this PR.
Relationship to Existing Definitions:
The real-number definitions in Wigner3j.lean remain authoritative. The new ℚ versions are computational aids; the corresponding proofs relate their results to the real-number formulation.
There are no corresponding rational versions yet on the underlying master branch. This PR therefore supplements the computational framework without replacing the existing definitions.
The formulation uses the existing Regge square: a 3×3 array of combinations of the angular momentum and magnetic quantum numbers, whose row and column sums each yield J = j_1 + j_2 + j_3.
Deliberately not included in this PR:
• No rational representation of the 3j symbol itself, since it is generally irrational.
• No 6j symbols. These will follow in a separate PR on the rational-6j branch, which builds on this PR.
• No complete verification of a value table. The two examples initially test the calculation process.
Verification:
Built on master at commit be0a9ee; The following tests were successful:
Build of the new module
lint-style.sh
alphaPythonLinters.sh
module_doc_lint
alphaFileImports and
Batteries-#lint for PhyslibAlpha.
lint_all and auxillary_script_test were not run.
References in the File:
The file refers to the following sources;
• Varshalovich, Moskalev, Khersonskii, Quantum Theory of Angular Momentum (1988):
◦ Section 8.1.3, p. 237, Eq. 8.1(14)– (18)
◦ Section 8.2, p. 237, Eq. 8.2(1)
◦ Section 8.2.1, p. 238, Eq. 8.2(3)
• DLMF, Section 34.2, Eqs. 34.2.4–34.2.5
The order of the rows here differs from that in Varshalovich 8.1(15): There, the second row is (j+m) ((R_{21}=a+\alpha)) and the third is (j-m) ((R_{31}=a-\alpha)). In physlib, it is the other way around: the second line is (j-m), and the third line is (j+m). This is documented both in the module documentation for
Wigner3j.leanand inreggeJwithinSixJSymmetry.lean.This convention already originates from the merged
Wigner3j.lean; so the PR does not introduce it anew but rather adopts it. Both examples follow this physlib convention.To perform the conversion, swap the last two rows. This corresponds to (m \mapsto -m) and yields the factor ((-1)^J). The corresponding lemma in physlib is called
threeJR_swap_rows.